package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.model.common.app.pojo.Announcements;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.service.AnnouncementsService;
import com.zhentao.mapper.AnnouncementsMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author lenovo
* @description 针对表【announcements】的数据库操作Service实现
* @createDate 2024-09-28 11:29:55
*/
@Service
public class AnnouncementsServiceImpl extends ServiceImpl<AnnouncementsMapper, Announcements>
    implements AnnouncementsService{
    @Resource
    private AnnouncementsMapper announcementsMapper;

    @Override
    public ResponseResult findAnnouncements() {
        LambdaQueryWrapper<Announcements> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Announcements::getStatus,1);
        wrapper.eq(Announcements::getIsDelete,2);
        List<Announcements> announcements = announcementsMapper.selectList(wrapper);
        return ResponseResult.okResult(announcements);
    }
}




